<?php
/**
 * @Notes:【】
 * @Date: 2022-06-08 23:24
 */

namespace App\Service\Task;

use App\Dao\Task\TaskHelpDao;
use App\Model\Task\TaskHelpCategory;
use App\Service\BaseService;
use Hyperf\Di\Annotation\Inject;

class TaskHelpService extends BaseService
{
    /**
     * @Inject()
     * @var TaskHelpDao
     */
    protected $taskHelpDao;

    /**
     * @Inject()
     * @var TaskHelpCategory
     */
    protected $taskHelpCategory;

    public function lists($params)
    {
        return $this->taskHelpDao->lists($params);
    }

    public function listsByCategory()
    {
        return $this->taskHelpCategory->with('TaskHelp')->get();
    }

    public function add(\App\Tool\Collect $params)
    {
        return $this->taskHelpDao->add($params);
    }

    public function edit(\App\Tool\Collect $params)
    {
        return $this->taskHelpDao->edit($params->get('id'), $params->except('id'));
    }

    public function del(mixed $id)
    {
        return $this->taskHelpDao->del($id);
    }

    
    public function detail(int $id)
    {
        return $this->taskHelpDao->read($id);
    }


}